Search Interview Questions | More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know. |
|
| ||||
Core java - Interview Questions and Answers for 'Nagarvision' - 3 question(s) found - Order By Newest | ||||
| ||||
Ans. ConcurrentHashMap is a hashMap that allows concurrent modifications from multiple threads as there can be multiple locks on the same hashmap. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   collections   hashmap   map   concurrenthashmap   concurrenthashmap  concurrency   general electric   ge Asked in 32 Companies   rare | ||||
Related Questions | ||||
What is ConcurrentModificationException ? | ||||
What is a BlockingQueue? | ||||
What is concurrent interface ? | ||||
What is ConcurrentLinkedDeque ? | ||||
What is CopyOnWriteArrayList ? | ||||
What are the advantages and disadvantages of CopyOnWriteArrayList ? | ||||
Name few Concurrent Collection Classes ? | ||||
Difference between concurrentHashMap and HashTable ? | ||||
isnt the use of HashTable and ConcurrentHashMap the same, i.e providing synchronized map collection ? | ||||
| ||||
Ans. A static initialization block is a normal block of code enclosed in braces, { }, and preceded by the static keyword. Here is an example: static { // whatever code is needed for initialization goes here } A class can have any number of static initialization blocks, and they can appear anywhere in the class body. The runtime system guarantees that static initialization blocks are called in the order that they appear in the source code. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   oops   static   static block Asked in 16 Companies basic   frequent | ||||
Related Questions | ||||
How can we run a java program without making any object? | ||||
How can we create objects if we make the constructor private ? | ||||
Similarity and Difference between static block and static method ? | ||||
Will the static block be executed in the following code ? Why ? | ||||
Is it possible to compile and run a Java program without writing main( ) method? | ||||
Will static block for Test Class execute in the following code ? | ||||
Can we initialize member variables within static block ? | ||||
How can we execute a Java class independently if it doesn't have a static main method ? | ||||
Can we create object in static block ? | ||||
| ||||
Ans. Hashcode is used for bucketing in Hash implementations like HashMap, HashTable, HashSet etc. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   string   hashcode   hash code   string comparison  hashtable Asked in 17 Companies basic   frequent | ||||
Related Questions | ||||
Which String class does not override the equals() and hashCode() methods, inheriting them directly from class Object? | ||||
Write a class and override the equals and hashcode method ? | ||||
How many threads can access a concurrent hashmap when the hashcode is overridden and always returns a zero. | ||||